package com.jinghao.tws.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jinghao.core.common.controller.JingHaoBaseController;
import com.jinghao.sys.entity.SysAccount;
import com.jinghao.tws.service.IWvPublicSysService;

@Controller
@Scope("prototype")
@RequestMapping(value = "/app/tws/public/sys")
public class WvPublicSysController extends JingHaoBaseController {
	//==================定制内容开始======================
//在这里修改代码
	
	/**
	 * 新增系统用户
	 * @param sysAccountService
	 */
	@ResponseBody
	@RequestMapping(value = "/addSysAccount",method = RequestMethod.POST) 
	public Map<String, Object> addSysAccount(@ModelAttribute("model") SysAccount model,@RequestBody Map<String,Object> map){
		model.setObjMap(map);
		this.getWvPublicSysService().addSysAccount(model);
        return model.getJson();  
	}
	
	/**
	 * 修改用户信息
	 * @param model
	 * @return
	 */
	
	@ResponseBody
	@RequestMapping(value = "/updateSysAccount",method = RequestMethod.POST) 
	public Map<String, Object> updateSysAccount(@ModelAttribute("model") SysAccount model,@RequestBody Map<String,Object> map){
		model.setObjMap(map);
		this.getWvPublicSysService().updateSysAccount(model);
        return model.getJson();  
	}
	//==================定制内容结束======================

	@Autowired
	public void setWvPublicSysService(IWvPublicSysService wvPublicSysService) {
		super.setIJingHaoBaseService(wvPublicSysService);
	}

	public IWvPublicSysService getWvPublicSysService() {
		return (IWvPublicSysService) super.getIJingHaoBaseService();
	}
}
